﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class DALComentario : DALBase
    {
        private static string cmdComentarios = "select * from Comentarios where ComId = @ComId";
        private static string cmdAltaComentario = "Insert into Comentarios (ValComentario,CliId,ComId) Values(@ValComentario,@CliId,@ComId)";


        public SqlDataReader buscarComentarios(int ComId)
        {
            List<SqlParameter> parametros = new List<SqlParameter>();
            parametros.Add(new SqlParameter("@ComId", ComId));
            SqlDataReader dr = select(parametros, cmdComentarios, CommandType.Text);
            return dr;
        }


        public Boolean AltaComentario(List<SqlParameter> parametros)
        {
            int ret = ejecutaNonQuery(cmdAltaComentario, parametros, CommandType.Text);
            if (ret > 0)
            {
                return true;
            }
            else
            {
                return false;
            }

        }
    }
        

}
